# @Author: Eric Ito
# @Date: 1/25/2009
# Project Euler problem 2

#acct 101565
#pin 7281912

"""
Find the sum of all the even-valued terms
in the Fibonacci sequence which do not 
exceed 4 million

1,2,3,5,8,13,21,34,55

"""
def genFibList():
	fibList = []
	fibList.append(1)
	fibList.append(2)
	i = 1
	i2 = 2
	while i + i2 < 4000000:
		fibList.append(i+i2)
		index = len(fibList)-1
		i = fibList[index]
		i2 = fibList[index-1]
		#fibList.append(i+i2)
		#print fibList
	return fibList	
def main():
	i = 0
	sum = 0
	fL = genFibList()
	for i in fL:
		if i % 2 == 0:
			sum += i
	print sum

if __name__ == '__main__':
	main()